using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using SIGCBI.Repository.Mapping;
using SIGCBI.Entities;

namespace SIGCBI.Repository
{
    public partial class SIGCBIContext : DbContext
    {
        static SIGCBIContext()
        {
            Database.SetInitializer<SIGCBIContext>
                (
                    null
                    //new DropCreateDatabaseAlways<SIGCBIContext>()
                    //new SICBIDatabaseInitializer()
                 );
        }

        public SIGCBIContext()
            : base("Name=SIGCBIContext")
        {
            this.Configuration.LazyLoadingEnabled = false;
            this.Configuration.ProxyCreationEnabled = false;
            this.Configuration.AutoDetectChangesEnabled = false;
        }

        public DbSet<CENTRO_COSTO> CENTRO_COSTOs { get; set; }
        public DbSet<FUENTE_FINANCIERA> FUENTE_FINANCIERAs { get; set; }
        public DbSet<REDUCIR_PRESUPUESTO> REDUCIR_PRESUPUESTOs { get; set; }

        public DbSet<BIEN> BIENs { get; set; }
        public DbSet<CATEGORIA> CATEGORIAs { get; set; }
        public DbSet<DETALLE_GUIA_ENTRADA> DETALLE_GUIA_ENTRADA { get; set; }
        public DbSet<DETALLE_PECOSA> DETALLE_PECOSA { get; set; }
        public DbSet<ESTADO_CIVIL> ESTADO_CIVIL { get; set; }
        public DbSet<FOTO_TRABAJADOR> FOTO_PERSONA { get; set; }
        public DbSet<FOTO_PRODUCTO> FOTO_PRODUCTO { get; set; }
        public DbSet<GUIA_ENTRADA> GUIA_ENTRADA { get; set; }
        public DbSet<KARDEX> KARDEXes { get; set; }
        public DbSet<MARCA> MARCAs { get; set; }
        public DbSet<MENU> MENUs { get; set; }
        public DbSet<PECOSA> PECOSAs { get; set; }
        public DbSet<TRABAJADOR> TRABAJADORes { get; set; }
        public DbSet<PRODUCTO> PRODUCTOes { get; set; }
        public DbSet<PROVEEDOR> PROVEEDORs { get; set; }
        public DbSet<ROL> ROLs { get; set; }
        public DbSet<SEXO> SEXOes { get; set; }
        public DbSet<sysdiagram> sysdiagrams { get; set; }
        public DbSet<UNIDAD_MEDIDA> UNIDAD_MEDIDAs { get; set; }
        public DbSet<USUARIO> USUARIOs { get; set; }
        public DbSet<USUARIO_MENU> USUARIO_MENU { get; set; }

        public DbSet<HABITACION> HABITACION { get; set; }
        public DbSet<ALQUILER> ALQUILER { get; set; }
        public DbSet<CLIENTE> CLIENTE { get; set; }
        public DbSet<SERVICIO> SERVICIO { get; set; }

        public DbSet<CAMBIO_PARTIDAS> CAMBIO_PARTIDAS { get; set; }
        public DbSet<DETALLE_PARTIDA> DETALLE_PARTIDA { get; set; }
        public DbSet<PARTIDA> PARTIDAs { get; set; }

        public DbSet<UserProfile> UserProfiles { get; set; }
        public DbSet<webpages_Membership> webpages_Membership { get; set; }
        public DbSet<webpages_OAuthMembership> webpages_OAuthMembership { get; set; }
        public DbSet<webpages_Roles> webpages_Roles { get; set; }


        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Configurations.Add(new AREAMap());
            modelBuilder.Configurations.Add(new BIENMap());
            modelBuilder.Configurations.Add(new CATEGORIAMap());
            modelBuilder.Configurations.Add(new DETALLE_GUIA_ENTRADAMap());
            modelBuilder.Configurations.Add(new DETALLE_PECOSAMap());
            modelBuilder.Configurations.Add(new ESTADO_CIVILMap());
            modelBuilder.Configurations.Add(new FOTO_TRABAJADORMap());
            modelBuilder.Configurations.Add(new FOTO_PRODUCTOMap());
            modelBuilder.Configurations.Add(new GUIA_ENTRADAMap());
            modelBuilder.Configurations.Add(new KARDEXMap());
            modelBuilder.Configurations.Add(new MARCAMap());
            modelBuilder.Configurations.Add(new MENUMap());
            modelBuilder.Configurations.Add(new PECOSAMap());
            modelBuilder.Configurations.Add(new TRABAJADORMap());
            modelBuilder.Configurations.Add(new PRODUCTOMap());
            modelBuilder.Configurations.Add(new PROVEEDORMap());
            modelBuilder.Configurations.Add(new ROLMap());
            modelBuilder.Configurations.Add(new SEXOMap());
            modelBuilder.Configurations.Add(new sysdiagramMap());
            modelBuilder.Configurations.Add(new UNIDAD_MEDIDAMap());
            modelBuilder.Configurations.Add(new USUARIOMap());
            modelBuilder.Configurations.Add(new USUARIO_MENUMap());

            modelBuilder.Configurations.Add(new ServicioMap());
            modelBuilder.Configurations.Add(new HabitacionMap());
            modelBuilder.Configurations.Add(new AlquilerMap());
            modelBuilder.Configurations.Add(new ClienteMap());

            modelBuilder.Configurations.Add(new CAMBIO_PARTIDASMap());
            modelBuilder.Configurations.Add(new DETALLE_PARTIDAMap());
            modelBuilder.Configurations.Add(new PARTIDAMap());
            modelBuilder.Configurations.Add(new FUENTE_FINANCIERAMap());
            modelBuilder.Configurations.Add(new ReducirPresupuestoMap());

            modelBuilder.Configurations.Add(new UserProfileMap());
            modelBuilder.Configurations.Add(new webpages_MembershipMap());
            modelBuilder.Configurations.Add(new webpages_OAuthMembershipMap());
            modelBuilder.Configurations.Add(new webpages_RolesMap());

        }
    }
}
